#ifndef __ULGFX_STATISTIC_H__
#define __ULGFX_STATISTIC_H__

#include "ULCore_Statistic.h"
#include "VSDL_point.h"
#include "VSDL_text.h"
#include "VSDL_menuBar.h"

#define ULG_STATISTIC_LEAST_SERIALS	15

#define ULG_STATISTIC_F_FONT_SET	1

//Statistic is shown as following chart:
// ---------------------------------------
//| Start Serial:xxxxxxxx Date:xxxxxxxx   |
//|---------------------------------------|
//| Red ones graph                        |
//|---------------------------------------|
//| Blue ones graph   | List 5 highest    |
//|                   | List 5 lowest     |
// ---------------------------------------
class ULG_Statistic{
private:
	unsigned char gfxFlags;
	VSDL_Point startXY;
	VSDL_Text msg;
	VSDL_MenuBar bar;
private:
	//For temproary use
	int tipRectWidth;
	int tipRectHeight;
	int fontWidth;
	int fontHeight;
	char msgBuffer[256];
	VSDL_Point currentXY;
	void GetHighestN(int *arr, int &count, ULC_PositionInfo *posInfo);
	void GetLowestN(int *arr, int &count, ULC_PositionInfo *posInfo);
public:
	void SetStartXY(VSDL_Point point);
	int Show(SDL_Surface *destSurf, int nSerials, ULC_Serial *serials, bool useSorted);
	int Show(SDL_Surface *destSurf, int nSerials, ULC_Serial *serials); //Caller must ensure nSerials can be shown in one screen(At least ULG_STATISTIC_LEAST_SERIALS)
	int SetFont(VSDL_Font *font);
};

#endif /*__ULGFX_STATISTIC_H__*/
